import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

public class MyTool {

    public static <T> List<T> castList(Object obj, Class<T> clazz) {

        List<T> result = new ArrayList<T>();
        if(obj instanceof List<?>) {

            for (Object o : (List<?>) obj) {

                result.add(clazz.cast(o));
            }
            return result;
        }
        return null;
    }

    public static String myFormat(double number) {
        DecimalFormat df = new DecimalFormat("#.00");
        return df.format(number);
    }
}
